//
//  ContractListCollectionViewCell.m
//  yonghu
//
//  Created by 浪尖渝力 on 2018/2/6.
//  Copyright © 2018年 com.DJS. All rights reserved.
//

#import "ContractListCollectionViewCell.h"

@implementation ContractListCollectionViewCell
-(void)creatView{
    UIImageView *imageView=[UIImageView new];
    [self addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_equalTo(0);
        make.bottom.mas_equalTo(-80);
    }];
    NSString *gtype_image=[_Dic objectForKey:@"goods_image"];
    NSURL *rul=[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",_addressUrl,gtype_image]];
    [imageView sd_setImageWithURL:rul];
    
    UIView *view=[UIView new];
    [self addSubview:view];
    [view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(0);
        make.top.mas_equalTo(imageView.mas_bottom);
    }];
    view.backgroundColor=ColorWithRGB(242, 249, 251);
    
    UILabel *label=[UILabel new];
    [view addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
        make.top.mas_equalTo(15);
    }];
    label.text=[_Dic objectForKey:@"goods_name"];
    label.font=[UIFont systemFontOfSize:18];
    label.textColor=ColorWithRGB(29, 29, 29);
    
    UILabel *label2=[UILabel new];
    [view addSubview:label2];
    [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(label);
        make.top.mas_equalTo(label.mas_bottom).mas_equalTo(20);
    }];
    NSNumber *goods_price=[_Dic objectForKey:@"goods_price"];
    label2.text=[NSString stringWithFormat:@"¥%@",goods_price];
    label2.textColor=[UIColor redColor];
    label2.font=[UIFont systemFontOfSize:16];
    
    
    UILabel *label3=[UILabel new];
    [view addSubview:label3];
    [label3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(label);
        make.top.mas_equalTo(label.mas_bottom).mas_equalTo(20);
    }];
    NSNumber *goods_sales=[_Dic objectForKey:@"goods_sales"];
    label3.text=[NSString stringWithFormat:@"销量：%@",goods_sales];
    label3.textColor=ColorWithRGB(149, 149, 149);
    label3.font=[UIFont systemFontOfSize:16];
}
@end
